package com.example.task;

import cn.hutool.core.date.DateUtil;
import com.example.bean.CronDefinition;

/**
 * 任务交换机
 * 分发器
 * @author ZhengDing
 * @date 2022/4/9 21:11
 */

public class TaskRunnableSwitch implements Runnable{
    
    private CronDefinition cronDefinition;
    
    public CronDefinition getCronDefinition() {
        return this.cronDefinition;
    }
    
    public TaskRunnableSwitch(CronDefinition cronDefinition) {
        this.cronDefinition = cronDefinition;
    }
    
    @Override
    public void run() {
        System.out.println(DateUtil.now() + " - " + cronDefinition.toString());
    }
}
